package com.zrrd.blog.system.api;

import com.zrrd.blog.system.req.RegisterREQ;
import com.zrrd.blog.system.req.SysUserUpdatePasswordREQ;
import com.zrrd.blog.system.service.ISysUserService;
import com.zrrd.blog.util.base.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Api(value = "用户管理接口",description = "用户管理，不需要身份认证")
@RestController
@RequestMapping("/api/user")
public class ApiSysUserController {
    @Autowired
    private ISysUserService sysUserService;

    @ApiOperation("检验用户名")
    @GetMapping("/user/{username}")
    public Result checkUsername(@PathVariable("username") String username){
        return sysUserService.checkUsername(username);
    }

    @ApiOperation("注册新用户")
    @PostMapping
    public Result RegisterUser(@RequestBody RegisterREQ req){
        return sysUserService.RegisterUser(req);
    }
}
